﻿using Business.StorageManagement;
using Business.StorageManagement.Dto;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;

namespace Business.Controllers
{
    [RemoteService]
    [Area("Business")]
    [Route("api/business/Storage")]
    public class StorageController : AbpController
    {
        private readonly IStorageAppService _StorageAppService;

        public StorageController(IStorageAppService StorageAppService)
        {
            _StorageAppService = StorageAppService;
        }

        [HttpPost]
        [Route("data-post")]
        public Task<StorageDto> CreateOrUpdate(StorageDto input)
        {
            return _StorageAppService.CreateOrUpdate(input);
        }

        [HttpPost]
        [Route("delete")]
        public Task Delete(List<Guid> ids)
        {
            return _StorageAppService.Delete(ids);
        }

        [HttpGet]
        [Route("{id}")]
        public Task<StorageDto> Get(Guid id)
        {
            return _StorageAppService.Get(id);
        }

        [HttpGet]
        public Task<PagedResultDto<StorageDto>> GetAll(GetStorageInputDto input)
        {
            return _StorageAppService.GetAll(input);
        }


    }
}

